home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Gamer (Italian) 36
/
PC Gamer IT CD 36 2-2.iso
/
VIGDEMO
/
data1.cab
/
Assets
/
scripts
/
marker.e
< prev
next >
Wrap
Text File
|
1998-09-21
|
3KB
|
586 lines
int Initialize(string type) {
global int mystate = 0;
global int gOccupiedBrain;
global int gStartSound = 45;
global int gProgressSound = 36;
global int gEndSound = 45;
global int gMsgSnd = -1;
Reset("dummy");
}
int Reset(string dummy)
{
print("start marker reset");
mystate = 0;
gOccupiedBrain = 0;
wakeupTime = -1.0;
SetCollidableProperties(thisObject,1,0);
SetStyle(thisObject,5);
}
int msgsnd(string soundname)
{
gMsgSnd = GetSoundIndex(soundname);
}
int startsound(string soundname)
{
gStartSound = GetSoundIndex(soundname);
}
int endsound(string soundname)
{
gEndSound = GetSoundIndex(soundname);
}
int progresssound(string soundname)
{
gProgressSound = GetSoundIndex(soundname);
}
int Vacant(string dummy)
{
int result;
int inBrain = Str2Int(dummy);
result = IsAuthoritative(thisObject);
if (result == 1)
{
if (mystate == 0)
{
ReturnValue(thisObject,1);
}
else if (gOccupiedBrain == inBrain)
{
ReturnValue(thisObject,1);
}
else
{
ReturnValue(thisObject,0);
}
}
else
ReturnValue(thisObject,0);
}
int Occupy(string dummy)
{
real time;
int inBrain = Str2Int(dummy);
time = GetTime(thisObject);
if (mystate == 0)
{
PlaySound(thisObject,gStartSound);
mystate = 1;
gOccupiedBrain = inBrain;
wakeupTime = time + 0.2;
}
}
int Colliders(string dummy)
{
map::iterator ix;
map::iterator iy;
map objInList;
int value;
objInList = Collisions(thisObject,0,1,0);
ix = begin(objInList);
iy = end(objInList);
if (ix != iy)
{
PlaySound(thisObject,gStartSound);
PlaySound(thisObject,gMsgSnd);
SendEnglishMessage(thisObject);
}
return 0;
}
int TimedEvent(int input)
{
real time;
time = GetTime(thisObject);
switch (mystate)
{
case 0:
wakeupTime = -1.0;
break;
case 1:
int result;
result = SearchArea(thisObject,2.0,0);
if (result == 0)
{
wakeupTime = -1.0;
mystate = 0;
gOccupiedBrain = 0;
}
else
{
wakeupTime = time + 1.0;
}
break;
}
return 0;
}